impl Solution {
    pub fn add_spaces(s: String, spaces: Vec<i32>) -> String {
        let mut ans=String::new();
        let mut p=0;
        for (i,v) in s.as_bytes().iter().enumerate(){
            if p<spaces.len()&&spaces[p]==i as i32{
                ans.push(' ');
                p+=1;
            }
            ans.push(*v as char);
        }
        ans
    }
}